package com.link2room.blaster.controller.api;

import com.link2room.blaster.dto.param.base.RegistrationVerificationBaseParamDto;
import com.link2room.blaster.facade.IRegistrationVerificationFacadeService;
import com.link2room.common.dto.result.base.BaseResultDto;

import com.link2room.blaster.dto.result.api.RegistrationVerificationResDto;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;

/**
 * Created by LN on 2016/10/27.
 */
@ApiIgnore
@RestController
@RequestMapping("/api/VerificationCodes")
@Deprecated
public class DayuVerificationMsgApiController {
    @Resource
    private IRegistrationVerificationFacadeService registrationVerificationFacadeService;

    @RequestMapping(method = RequestMethod.POST)

    public BaseResultDto sendMsg(
            @RequestBody RegistrationVerificationBaseParamDto paramDto
    ) throws Exception {
        RegistrationVerificationResDto res = registrationVerificationFacadeService.sendSignupVerificationCode(paramDto);
        BaseResultDto resultDto = new BaseResultDto();
        resultDto.setResultCode(0);
        resultDto.setResultInfo(res);
        return resultDto;
    }

    @RequestMapping(method = RequestMethod.PUT)
    public BaseResultDto verifyCode(
            @RequestBody RegistrationVerificationBaseParamDto paramDto
    ) throws Exception {
        registrationVerificationFacadeService.signupVerifyCode(paramDto);
        BaseResultDto resultDto = new BaseResultDto();
        resultDto.setResultCode(0);
        return resultDto;
    }

}
